package com.shigi.sat;

import com.shigi.problem.Problem;
import com.shigi.sat.ga.GASolver;
import com.shigi.sat.structure.SatInstance;
import com.shigi.sat.structure.SatSolution;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Miroslav Šiagi on 27/01/15.
 */
public class SatProblem implements Problem {

    private List<SatInstance> instances = new ArrayList<>();
    private List<SatSolution> solutions = new ArrayList<>();
    private GASolver solver;


    public SatProblem(SatLoader satLoader, GASolver solver) {
        this.instances = satLoader.loadInstances();
        this.solver = solver;
    }

    @Override
    public void solve() {
        for(SatInstance satInstance : instances) {
            this.solutions.add(this.solver.solve(satInstance));
        }
    }

}
